package com.mynature.booking.manager;

import java.sql.SQLException;
import com.mynature.booking.database.DatabaseManager;
import com.mynature.booking.model.LogAndCreate;
import com.mynature.booking.model.Person;
public class BookingManager {

	public boolean booking() {
		boolean result = true;
		// TODO
		System.out.println("booking action start...OK");

	

		return result;
	}

	/**
	 * 
	 * @return
	 */
	public static boolean summitPersonInfo() {
		// collection user info.
		Person person = new Person();
		person.setAge(17);
		person.setName("yuewang");
		person.setIdcard(123456);
		person.setSex("Male");
		person.setPhone(110);
		// user click confirm.
		int rowNum = DatabaseManager.getInstance().insertPerson(person);
		return (rowNum > 0);
	}

	
	
	/**
	 * @return
	 */
	public boolean cancelation() {
		boolean result = true;

		return result;
	}
    



	/**
	 * Test code
	 * @param args
	 * @throws SQLException
	 */
	public static void main(String args[]) throws SQLException {
		LogAndCreate frame = new LogAndCreate();
		frame.setVisible(true);

		DatabaseManager db = DatabaseManager.getInstance();
		db.connectMyNature();
		BookingManager manager = new BookingManager();
		manager.booking();
		
	}

}